import java.util.Arrays;
import java.util.Scanner;

public class Learn_2 {
    public static int fib(int n){
        if(n == 1 || n == 2){
            return 1;
        }else{
            return fib(n-1) + fib(n-2);
        }
    }
    public static int fib2(int n){
        int a = 1;
        int b = 1;
        int c = 1;
        while(n>2){
            c = a + b;
            a = b;
            b = c;
            n--;
        }
        return c;
    }
    public static void main(String[] args) {
        System.out.println(fib(6));
        System.out.println(fib2(6));
        System.out.println(fib(40));
        System.out.println(fib2(40));
    }
    public static void main6(String[] args) {
        int[] arr = new int[]{1,2,3,4,5,6,7,8,9,10};
        for (int i = 0; i < arr.length; i++) {
            System.out.println(arr[i]);
        }
    }
    public static int add(int a,int b){
        return a+b;
    }
    public static int add(int a,int b,int c){
        return a+b+c;
    }
    public static double add(int a,double b,int c){
        return a+b+c;
    }
    public static double add(int a,int c,double b){
        return a+b+c;
    }
    public static void main5(String[] args) {
        int a = 10;
        int b = 20;
        int c = 30;
        double d = 20;
        System.out.println(add(a,b));
        System.out.println(add(a,b,c));
        System.out.println(add(a,c,d));
        System.out.println(add(a,d,c));
    }
    public static void main4(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str = sc.nextLine();
        System.out.println(str);
        String str1 = sc.next();
        System.out.println(str1);
    }
    public static void main3(String[] args) {
        Scanner sc = new Scanner(System.in);
        float m = sc.nextFloat();
        System.out.println(m);
    }
    public static void main2(String[] args) {
        Scanner sc = new Scanner(System.in);
        while(sc.hasNext()){
            int a = sc.nextInt();
            System.out.println(a);
        }
    }
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        System.out.println(n);
    }
}
